	function IsDigit(cCheck){
		return ((('0'<=cCheck) && (cCheck<='9'))||cCheck=='.');
	}

	function IsEmpty(value,obj,tip){
		value = value.replace(/^\s+|\s+$/,'');
		if(value==''){
			obj.next().attr("class","tip");
			obj.next().html(tip);
			return true;
		}else{
			obj.next().attr("class","");
			obj.next().html('');
			return false;
		}
	}

	function CheckNum(charValue,alertValue,obj){
		for(var iIndex=0;iIndex<charValue.length;iIndex++) {
			var cCheck=charValue.charAt(iIndex);
			if(!IsDigit(cCheck)){
				obj.next().attr("class","tip");
				obj.next().html(alertValue);
				obj.focus();
				return true;
			}
		}
		obj.next().attr("class","");
		obj.next().html('');
		return false;
	}

	function MilliFormat(fSum){
           var strSum;   
           var behind = ""; 
		   strSum = new String(fSum);
           if(strSum.indexOf(".") > -1){                  
                behind = strSum.split(".")[1];  
                strSum = strSum.split(".")[0];  
           } 
            var len;  
            var result = "";    
            var temp = "";       
            len = strSum.length;       
            while(len > 3){                  
                temp = ","+strSum.substring(len - 3,len);  
                strSum = strSum.substring(0,len - 3);                  
                result = temp + result;  
                len = strSum.length;  
            }  
            if(len > 0)  {  
                result = strSum + result;  
            }  
            if(behind!="")  
                result+= "." + behind; 
			 return result;	
	}


	function db_reset(){
		$('.ipt155').val('');
		$('#bricktype').val('');
		$('#rate').val('1.05');
		$('.jgspan').html('');
	}

	function db_autoinput(){
		var bricktype = $('#bricktype').val();
	
		switch(bricktype){
			case '1':
				 $('#floor_long').val(600);
				 $('#floor_width').val(90);
				 break;
			case '2':
				 $('#floor_long').val(750);
				 $('#floor_width').val(90);
				 break;
			case '3':
				 $('#floor_long').val(900);
				 $('#floor_width').val(90);
				 break;
			case '4':
				 $('#floor_long').val(1285);
				 $('#floor_width').val(192);
				  break;
			default:
				 $('#floor_long').val('');
				 $('#floor_width').val('');					
		}
	}


	function db_calculate(){	
		var obj = $('#room_long');
		var room_long = obj.val();
		if(IsEmpty(room_long,obj,'房间长度不能为空！')) return false;
		if(CheckNum(room_long,'房间长度只能输入数字格式!',obj)) return false;
		if(room_long>10000) { obj.next().attr("class","tip");obj.next().html('数值过大不合理，请重新输入！');return false; }

		var obj = $('#room_width');
		var room_width = obj.val();
		if(IsEmpty(room_width,obj,'房间宽度不能为空！')) return false;
		if(CheckNum(room_width,'房间宽度只能输入数字格式!',obj)) return false;
		if(room_width>10000) { obj.next().attr("class","tip");obj.next().html('数值过大不合理，请重新输入！');return false; }

		var obj = $('#floor_long');
		var floor_long = obj.val();
		if(IsEmpty(floor_long,obj,'地板长度不能为空！')) return false;
		if(CheckNum(floor_long,'地板长度只能输入数字格式!',obj)) return false;	
		if(floor_long>10000) { obj.next().attr("class","tip");obj.next().html('数值过大不合理，请重新输入！');return false; }
		if(floor_long<=0) { obj.next().attr("class","tip");obj.next().html('数值要大于0，请重新输入！');return false; }
		
		var obj = $('#floor_width');
		var floor_width = obj.val();
		if(IsEmpty(floor_width,obj,'地板宽度不能为空！')) return false;
		if(CheckNum(floor_width,'地板宽度只能输入数字格式!',obj)) return false;	
		if(floor_width>10000) { obj.next().attr("class","tip");obj.next().html('数值过大不合理，请重新输入！');return false; }
		if(floor_width<=0) { obj.next().attr("class","tip");obj.next().html('数值要大于0，请重新输入！');return false; }

		var obj = $('#room_price');
		var room_price = obj.val();
		if(IsEmpty(room_price,obj,'地板单价不能为空！')) return false;
		if(CheckNum(room_price,'地板单价只能输入数字格式!',obj)) return false;	
		if(room_price>10000) { obj.next().attr("class","tip");obj.next().html('数值过大不合理，请重新输入！');return false; }

		var rate = $('#rate').val();
		var floornum = 0;
		var floorprice = dbprice = 0;
		var jgspan_area = room_long*room_width;
		jgspan_area = jgspan_area.toFixed(2);

		room_long = room_long*1000;
		room_width = room_width*1000;
		floornum = Math.ceil((room_long/floor_long)*(room_width/floor_width)*rate);
		floorprice = dbprice = (floornum)*(room_price);
		floorprice = floorprice.toFixed(2);
		floorprice = MilliFormat(floorprice);
		$('#floornum').html(floornum);
		$('#floorprice').html(floorprice);

		$('#jgspan_area').html(jgspan_area);
		$('#db_area').val(jgspan_area);
		$('#print_area').val(jgspan_area);
		$('#jgspan_price').html(room_price);
		$('#db_price').val(room_price);
		$('#print_price').val(room_price);
		$('#jgspan_num').html(floornum);
		$('#db_num').val(floornum);
		$('#print_num').val(floornum);
		$('#jgspan_total').html(floorprice);
		$('#db_total').val(floorprice);
		$('#print_total').val(floorprice);

		location.hash='anchor';
		
	}


		function bz_reset(){
		$('.ipt155').val('');
		$('.jgspan').html('');
		$('#room_vol').val(5.2);
	}

	function bz_calculate(){
		var obj = $('#room_height');
		var room_height = obj.val();
		if(IsEmpty(room_height,obj,'墙面高度不能为空！')) return false;
		if(CheckNum(room_height,'墙面高度只能输入数字格式!',obj)) return false;
		if(room_height>10000) { obj.next().attr("class","tip");obj.next().html('数值过大不合理，请重新输入！');return false; }

		var obj = $('#room_long');
		var room_long = obj.val();
		if(IsEmpty(room_long,obj,'墙面长度不能为空！')) return false;
		if(CheckNum(room_long,'墙面长度只能输入数字格式!',obj)) return false;
		if(room_long>10000) { obj.next().attr("class","tip");obj.next().html('数值过大不合理，请重新输入！');return false; }

		var obj = $('#room_num');
		var room_num = obj.val();
		if(IsEmpty(room_num,obj,'墙面数量不能为空！')) return false;
		if(CheckNum(room_num,'墙面数量只能输入数字格式!',obj)) return false;
		if(room_num>10000) { obj.next().attr("class","tip");obj.next().html('数值过大不合理，请重新输入！');return false; }

		var obj = $('#room_vol');
		var room_vol = obj.val();
		if(IsEmpty(room_vol,obj,'壁纸规格不能为空！')) return false;
		if(CheckNum(room_vol,'壁纸规格只能输入数字格式!',obj)) return false;
		if(room_vol>10000) { obj.next().attr("class","tip");obj.next().html('数值过大不合理，请重新输入！');return false; }
		if(room_vol<=0) { obj.next().attr("class","tip");obj.next().html('壁纸规格数值大于0，请重新输入！');return false; }

		var obj = $('#room_price');
		var room_price = obj.val();
		if(IsEmpty(room_price,obj,'壁纸单价不能为空！')) return false;
		if(CheckNum(room_price,'壁纸单价只能输入数字格式!',obj)) return false;
		if(room_price>10000) { obj.next().attr("class","tip");obj.next().html('数值过大不合理，请重新输入！');return false; }

		var room_block = 0;
		var room_total = 0;
		var jgspan_area = parseFloat(room_long)*parseFloat(room_height)*parseFloat(room_num);
		jgspan_area = jgspan_area.toFixed(2);

		room_block = Math.ceil(parseFloat(room_long)*parseFloat(room_height)*parseFloat(room_num)*1.1/room_vol);
		room_total = parseFloat(room_block)*parseFloat(room_price);
		room_total = room_total.toFixed(2);
		room_total = MilliFormat(room_total);
		
		$('#room_block').html(room_block);
		$('#room_total').html(room_total);

		$('#jgspan_area').html(jgspan_area);
		$('#bz_area').val(jgspan_area);
		$('#print_area').val(jgspan_area);

		$('#jgspan_price').html(room_price);
		$('#bz_price').val(room_price);
		$('#print_price').val(room_price);

		$('#jgspan_num').html(room_block);
		$('#bz_num').val(room_block);
		$('#print_num').val(room_block);

		$('#jgspan_total').html(room_total);
		$('#bz_total').val(room_total);
		$('#print_total').val(room_total);
	}

		function cl_reset(){
		$('.ipt155').val('');
		$('.jgspan').html('');
		
	}

	function cl_calculate(){
		var obj = $('#window_height');
		var window_height = obj.val();
		if(IsEmpty(window_height,obj,'窗户高度不能为空！')) return false;
		if(CheckNum(window_height,'窗户高度只能输入数字格式!',obj)) return false;
		if(window_height>10000) { obj.next().attr("class","tip");obj.next().html('数值过大不合理，请重新输入！');return false; }	
		
		var obj = $('#window_width');
		var window_width = obj.val();
		if(IsEmpty(window_width,obj,'窗户长度不能为空！')) return false;
		if(CheckNum(window_width,'窗户长度只能输入数字格式!',obj)) return false;
		if(window_width>10000) { obj.next().attr("class","tip");obj.next().html('数值过大不合理，请重新输入！');return false; }

		var obj = $('#window_num');
		var window_num = obj.val();
		if(IsEmpty(window_num,obj,'窗户扇数不能为空！')) return false;
		if(CheckNum(window_num,'窗户扇数只能输入数字格式!',obj)) return false;
		if(window_num>10000) { obj.next().attr("class","tip");obj.next().html('数值过大不合理，请重新输入！');return false; }

		var obj = $('#cloth_width');
		var cloth_width = obj.val();
		if(IsEmpty(cloth_width,obj,'布料宽度不能为空！')) return false;
		if(CheckNum(cloth_width,'布料宽度只能输入数字格式!',obj)) return false;
		if(cloth_width>10000) { obj.next().attr("class","tip");obj.next().html('数值过大不合理，请重新输入！');return false; }
		if(cloth_width<=0) { obj.next().attr("class","tip");obj.next().html('数值要大于0，请重新输入！');return false; }

		var obj = $('#cloth_price');
		var cloth_price = obj.val();
		if(IsEmpty(cloth_price,obj,'布料单价不能为空！')) return false;
		if(CheckNum(cloth_price,'布料单价只能输入数字格式!',obj)) return false;
		if(cloth_price>10000) { obj.next().attr("class","tip");obj.next().html('数值过大不合理，请重新输入！');return false; }

		var cloth_num = ((parseFloat(window_width)+parseFloat(0.15*2))*2)/cloth_width*(parseFloat(0.15)+parseFloat(window_height)+parseFloat(0.5)+parseFloat(0.2))*window_num;
		cloth_num = Math.ceil(cloth_num);
		var cloth_total = cloth_num*parseFloat(cloth_price);
		cloth_total = cloth_total.toFixed(2);
		cloth_total = MilliFormat(cloth_total);
		var jgspan_area = parseFloat(window_height)*parseFloat(window_width);
		jgspan_area = jgspan_area.toFixed(2);

		$('#cloth_num').html(cloth_num);
		$('#cloth_total').html(cloth_total);

		$('#jgspan_area').html(jgspan_area);
		$('#cl_area').val(jgspan_area);
		$('#print_area').val(jgspan_area);

		$('#jgspan_volum').html(window_num);
		$('#cl_volum').val(window_num);
		$('#print_volum').val(window_num);

		$('#jgspan_price').html(cloth_price);
		$('#cl_price').val(cloth_price);
		$('#print_price').val(cloth_price);

		$('#jgspan_num').html(cloth_num);
		$('#cl_num').val(cloth_num);
		$('#print_num').val(cloth_num);

		$('#jgspan_total').html(cloth_total);
		$('#cl_total').val(cloth_total);
		$('#print_total').val(cloth_total);

	}

	function dz_reset(){
		$('.ipt155').val('');
		$('.jgspan').html('');
		$('#bricktype').val('');
	}
	function dz_autoinput(){
		var bricktype = $('#bricktype').val();
		switch(bricktype){
			case '1':
				$('#floor_width').val(300)
				$('#floor_height').val(300)
				break;
			case '2':
				$('#floor_width').val(400)
				$('#floor_height').val(400)
				break;
			case '3':
				$('#floor_width').val(600)
				$('#floor_height').val(600)
				break;
			default:
				$('#floor_width').val('')
				$('#floor_height').val('')				
		}
	}

	function dz_calculate(){
		var obj = $('#room_width');
		var room_width = obj.val();
		if(IsEmpty(room_width,obj,'房间长度不能为空！')) return false;
		if(CheckNum(room_width,'房间长度只能输入数字格式!',obj)) return false;
		if(room_width>10000) { obj.next().attr("class","tip");obj.next().html('数值过大不合理，请重新输入！');return false; }	
		
		var obj = $('#room_height');
		var room_height = obj.val();
		if(IsEmpty(room_height,obj,'房间宽度不能为空！')) return false;
		if(CheckNum(room_height,'房间宽度只能输入数字格式!',obj)) return false;
		if(room_height>10000) { obj.next().attr("class","tip");obj.next().html('数值过大不合理，请重新输入！');return false; }	

		var obj = $('#floor_width');
		var floor_width = obj.val();
		if(IsEmpty(floor_width,obj,'地砖长度不能为空！')) return false;
		if(CheckNum(floor_width,'地砖长度只能输入数字格式!',obj)) return false;
		if(floor_width>10000) { obj.next().attr("class","tip");obj.next().html('数值过大不合理，请重新输入！');return false; }	
		if(floor_width<=0) { obj.next().attr("class","tip");obj.next().html('数值要大于0，请重新输入！');return false; }

		var obj = $('#floor_height');
		var floor_height = obj.val();
		if(IsEmpty(floor_height,obj,'地砖宽度不能为空！')) return false;
		if(CheckNum(floor_height,'地砖宽度只能输入数字格式!',obj)) return false;
		if(floor_height>10000) { obj.next().attr("class","tip");obj.next().html('数值过大不合理，请重新输入！');return false; }	
		if(floor_height<=0) { obj.next().attr("class","tip");obj.next().html('数值要大于0，请重新输入！');return false; }

		var obj = $('#floor_price');
		var floor_price = obj.val();
		if(IsEmpty(floor_price,obj,'地砖单价不能为空！')) return false;
		if(CheckNum(floor_price,'地砖单价只能输入数字格式!',obj)) return false;
		if(floor_price>10000) { obj.next().attr("class","tip");obj.next().html('数值过大不合理，请重新输入！');return false; }

		var room_num = 0; 
		var room_total = 0;
		var rate = 1.05;
		var jgspan_area = parseFloat(room_width)*parseFloat(room_height)
			jgspan_area = jgspan_area.toFixed(2);
		room_width = parseFloat(room_width)*1000;
		room_height = parseFloat(room_height)*1000;
		room_num = Math.ceil((room_width/floor_width)*(room_height/floor_height)*parseFloat(rate));
		room_total = parseFloat(room_num)*parseFloat(floor_price);
		room_total = room_total.toFixed(2);
		room_total = MilliFormat(room_total);

		$('#room_num').html(room_num);
		$('#room_total').html(room_total);

		$('#jgspan_area').html(jgspan_area);
		$('#dz_area').val(jgspan_area);
		$('#print_area').val(jgspan_area);
		$('#jgspan_price').html(floor_price);
		$('#dz_price').val(floor_price);
		$('#print_price').val(floor_price);
		$('#jgspan_num').html(room_num);
		$('#dz_num').val(room_num);
		$('#print_num').val(room_num);
		$('#jgspan_total').html(room_total);
		$('#dz_total').val(room_total);
		$('#print_total').val(room_total);
		
	}

		function IsEmpty_load(value,obj,tip){
		value = value.replace(/^\s+|\s+$/,'');
		if(value==''){
			$('#'+obj+'_tip').attr("class","tip");
			$('#'+obj+'_tip').html(tip);
			return true;
		}else{
			$('#'+obj+'_tip').attr("class","");
			$('#'+obj+'_tip').html('');
			return false;
		}
	}

	function CheckNum_load(charValue,alertValue,obj){
		for(var iIndex=0;iIndex<charValue.length;iIndex++) {
			var cCheck=charValue.charAt(iIndex);
			if(!IsDigit(cCheck)){
				$('#'+obj+'_tip').attr("class","tip");
				$('#'+obj+'_tip').html(alertValue);
				$('#'+obj).focus();
				return true;
			}
		}
		$('#'+obj+'_tip').attr("class","");
		$('#'+obj+'_tip').html('');
		return false;
	}

	function qz_autoinput(){
		var brick_type = $('#brick_type').val();
		switch(brick_type){
			case '1':
				$('#brick_long').val(200);
				$('#brick_width').val(200);
				break;
			case '2':
				$('#brick_long').val(300);
				$('#brick_width').val(200);
				break;
			case '3':
				$('#brick_long').val(250);
				$('#brick_width').val(330);
				break;
			case '4':
				$('#brick_long').val(300);
				$('#brick_width').val(300);
				break;
			case '5':
				$('#brick_long').val(300);
				$('#brick_width').val(450);
				break;
			case '6':
				$('#brick_long').val(400);
				$('#brick_width').val(400);
				break;
			case '7':
				$('#brick_long').val(500);
				$('#brick_width').val(500);
				break;
			case '8':
				$('#brick_long').val(600);
				$('#brick_width').val(600);
				break;
			default:
				$('#brick_long').val('');
				$('#brick_width').val('');
		}
	}

	function qz_reset(){
		$('.ipt155').val('');
		$('.ipt55').val('');
		$('.jgspan').html('');	
		$('#brick_type').val('');
	}

	function qz_calculate(){
		var obj = $('#wall_long');
		var wall_long = obj.val();
		if(IsEmpty(wall_long,obj,'墙面长度不能为空！')) return false;
		if(CheckNum(wall_long,'墙面长度只能输入数字格式!',obj)) return false;
		if(wall_long>10000) { obj.next().attr("class","tip");obj.next().html('数值过大不合理，请重新输入！');return false; }	

		var obj = $('#room_long');
		var room_long = obj.val();
		if(IsEmpty(room_long,obj,'房间长度不能为空！')) return false;
		if(CheckNum(room_long,'房间长度只能输入数字格式!',obj)) return false;
		if(room_long>10000) { obj.next().attr("class","tip");obj.next().html('数值过大不合理，请重新输入！');return false; }
		
		var obj = $('#wall_width');
		var wall_width = obj.val();
		if(IsEmpty(wall_width,obj,'房间宽度不能为空！')) return false;
		if(CheckNum(wall_width,'房间宽度只能输入数字格式!',obj)) return false;
		if(wall_width>10000) { obj.next().attr("class","tip");obj.next().html('数值过大不合理，请重新输入！');return false; }

		var obj = $('#door_height');
		var door_height = obj.val();
		if(IsEmpty_load(door_height,'door_height','房门高度不能为空！')) return false;
		if(CheckNum_load(door_height,'房门高度只能输入数字格式!','door_height')) return false;
		if(door_height>10000) { $('#door_height_tip').attr("class","tip");$('#door_height_tip').html('数值过大不合理，请重新输入！');return false; }

		var obj = $('#door_width');
		var door_width = obj.val();
		if(IsEmpty_load(door_width,'door_width','房门宽度不能为空！')) return false;
		if(CheckNum_load(door_width,'房门宽度只能输入数字格式!','door_width')) return false;
		if(door_width>10000) { $('#door_width_tip').attr("class","tip");$('#door_width_tip').html('数值过大不合理，请重新输入！');return false; }
		
		var obj = $('#door_num');
		var door_num = obj.val();
		if(IsEmpty_load(door_num,'door_num','房门扇数不能为空！')) return false;
		if(CheckNum_load(door_num,'房门扇数只能输入数字格式!','door_num')) return false;
		if(door_num>10000) { $('#door_num_tip').attr("class","tip");$('#door_num_tip').html('数值过大不合理，请重新输入！');return false; }

		var obj = $('#window_height');
		var window_height = obj.val();
		if(IsEmpty_load(window_height,'window_height','窗户高度不能为空！')) return false;
		if(CheckNum_load(window_height,'窗户高度只能输入数字格式!','window_height')) return false;
		if(window_height>10000) { $('#window_height_tip').attr("class","tip");$('#window_height_tip').html('数值过大不合理，请重新输入！');return false; }

		var obj = $('#window_width');
		var window_width = obj.val();
		if(IsEmpty_load(window_width,'window_width','窗户宽度不能为空！')) return false;
		if(CheckNum_load(window_width,'窗户宽度只能输入数字格式!','window_width')) return false;
		if(window_width>10000) { $('#window_width_tip').attr("class","tip");$('#window_width_tip').html('数值过大不合理，请重新输入！');return false; }

		var obj = $('#window_num');
		var window_num = obj.val();
		if(IsEmpty_load(window_num,'window_num','窗户扇数不能为空！')) return false;
		if(CheckNum_load(window_num,'窗户扇数只能输入数字格式!','window_num')) return false;
		if(window_num>10000) { $('#window_num_tip').attr("class","tip");$('#window_num_tip').html('数值过大不合理，请重新输入！');return false; }

		var obj = $('#brick_long');
		var brick_long = obj.val();
		if(IsEmpty(brick_long,obj,'墙砖长度不能为空！')) return false;
		if(CheckNum(brick_long,'墙砖长度只能输入数字格式!',obj)) return false;
		if(brick_long>10000) { obj.next().attr("class","tip");obj.next().html('数值过大不合理，请重新输入！');return false; }

		var obj = $('#brick_width');
		var brick_width = obj.val();
		if(IsEmpty(brick_width,obj,'墙砖宽度不能为空！')) return false;
		if(CheckNum(brick_width,'墙砖宽度只能输入数字格式!',obj)) return false;
		if(brick_width>10000) { obj.next().attr("class","tip");obj.next().html('数值过大不合理，请重新输入！');return false; }

		var obj = $('#brick_width');
		var brick_width = obj.val();
		if(IsEmpty(brick_width,obj,'墙砖宽度不能为空！')) return false;
		if(CheckNum(brick_width,'墙砖宽度只能输入数字格式!',obj)) return false;
		if(brick_width>10000) { obj.next().attr("class","tip");obj.next().html('数值过大不合理，请重新输入！');return false; }

		var obj = $('#brick_price');
		var brick_price = obj.val();
		if(IsEmpty(brick_price,obj,'墙砖单价不能为空！')) return false;
		if(CheckNum(brick_price,'墙砖单价只能输入数字格式!',obj)) return false;
		if(brick_price>10000) { obj.next().attr("class","tip");obj.next().html('数值过大不合理，请重新输入！');return false; }

		var room_num = 0;
		var room_total = 0;
		var total_area = 0;
		var door_area = 0;
		var window_area = 0;
		var jgspan_area = 0;
		total_area = wall_long*2*room_long*2*wall_width//总面积
		door_area  = door_height*door_width*door_num//门面积
		window_area = window_height*window_width*window_num//窗面积
		jgspan_area = total_area-door_area-window_area;
		jgspan_area = jgspan_area.toFixed(2);

		room_long = room_long*1000;
		wall_long = wall_long*1000;
		wall_width = wall_width*1000;
		door_height = door_height*1000;
		door_width = door_width*1000;
		window_height = window_height*1000;
		window_width = window_width*1000;

		room_num = (room_long/brick_long)*(wall_long/brick_width)*2;
		room_num = parseFloat(room_num)+parseFloat((wall_width/brick_long)*(wall_long/brick_width)*2);
		room_num = parseFloat(room_num)-parseFloat((window_height/brick_long)*(window_width/brick_width)*window_num);
		room_num = parseFloat(room_num)-parseFloat((door_height/brick_long)*(door_width/brick_width)*door_num);
		room_num = Math.ceil(room_num*1.05);
		room_total = room_num*parseFloat(brick_price);
		room_total = room_total.toFixed(2);
		room_total = MilliFormat(room_total);

		$('#room_num').html(room_num);
		$('#room_total').html(room_total);

		$('#jgspan_area').html(jgspan_area);
		$('#qz_area').val(jgspan_area);
		$('#print_area').val(jgspan_area);
		$('#jgspan_price').html(brick_price);
		$('#qz_price').val(brick_price);
		$('#print_price').val(brick_price);
		$('#jgspan_num').html(room_num);
		$('#qz_num').val(room_num);
		$('#print_num').val(room_num);
		$('#jgspan_total').html(room_total);
		$('#qz_total').val(room_total);
		$('#print_total').val(room_total);
	}

	function tl_reset(){
		$('.ipt155').val('');
		$('.ipt55').val('');
		$('.jgspan').html('');
		$('#paint_cover').val(8.6);
	}

	function tl_calculate(){
		var obj = $('#wall_long');
		var wall_long = obj.val();
		if(IsEmpty(wall_long,obj,'墙面长度不能为空！')) return false;
		if(CheckNum(wall_long,'墙面长度只能输入数字格式!',obj)) return false;
		if(wall_long>10000) { obj.next().attr("class","tip");obj.next().html('数值过大不合理，请重新输入！');return false; }	

		var obj = $('#room_long');
		var room_long = obj.val();
		if(IsEmpty(room_long,obj,'房间长度不能为空！')) return false;
		if(CheckNum(room_long,'房间长度只能输入数字格式!',obj)) return false;
		if(room_long>10000) { obj.next().attr("class","tip");obj.next().html('数值过大不合理，请重新输入！');return false; }
		
		var obj = $('#wall_width');
		var wall_width = obj.val();
		if(IsEmpty(wall_width,obj,'房间宽度不能为空！')) return false;
		if(CheckNum(wall_width,'房间宽度只能输入数字格式!',obj)) return false;
		if(wall_width>10000) { obj.next().attr("class","tip");obj.next().html('数值过大不合理，请重新输入！');return false; }

		var obj = $('#door_height');
		var door_height = obj.val();
		if(IsEmpty_load(door_height,'door_height','房门高度不能为空！')) return false;
		if(CheckNum_load(door_height,'房门高度只能输入数字格式!','door_height')) return false;
		if(door_height>10000) { $('#door_height_tip').attr("class","tip");$('#door_height_tip').html('数值过大不合理，请重新输入！');return false; }

		var obj = $('#door_width');
		var door_width = obj.val();
		if(IsEmpty_load(door_width,'door_width','房门宽度不能为空！')) return false;
		if(CheckNum_load(door_width,'房门宽度只能输入数字格式!','door_width')) return false;
		if(door_width>10000) { $('#door_width_tip').attr("class","tip");$('#door_width_tip').html('数值过大不合理，请重新输入！');return false; }
		
		var obj = $('#door_num');
		var door_num = obj.val();
		if(IsEmpty_load(door_num,'door_num','房门扇数不能为空！')) return false;
		if(CheckNum_load(door_num,'房门扇数只能输入数字格式!','door_num')) return false;
		if(door_num>10000) { $('#door_num_tip').attr("class","tip");$('#door_num_tip').html('数值过大不合理，请重新输入！');return false; }

		var obj = $('#window_height');
		var window_height = obj.val();
		if(IsEmpty_load(window_height,'window_height','窗户高度不能为空！')) return false;
		if(CheckNum_load(window_height,'窗户高度只能输入数字格式!','window_height')) return false;
		if(window_height>10000) { $('#window_height_tip').attr("class","tip");$('#window_height_tip').html('数值过大不合理，请重新输入！');return false; }

		var obj = $('#window_width');
		var window_width = obj.val();
		if(IsEmpty_load(window_width,'window_width','窗户宽度不能为空！')) return false;
		if(CheckNum_load(window_width,'窗户宽度只能输入数字格式!','window_width')) return false;
		if(window_width>10000) { $('#window_width_tip').attr("class","tip");$('#window_width_tip').html('数值过大不合理，请重新输入！');return false; }

		var obj = $('#window_num');
		var window_num = obj.val();
		if(IsEmpty_load(window_num,'window_num','窗户扇数不能为空！')) return false;
		if(CheckNum_load(window_num,'窗户扇数只能输入数字格式!','window_num')) return false;
		if(window_num>10000) { $('#window_num_tip').attr("class","tip");$('#window_num_tip').html('数值过大不合理，请重新输入！');return false; }

		var obj = $('#paint_cover');
		var paint_cover = obj.val();
		if(IsEmpty(paint_cover,obj,'涂料覆盖率不能为空！')) return false;
		if(CheckNum(paint_cover,'涂料覆盖率只能输入数字格式!',obj)) return false;
		if(paint_cover>10000) { obj.next().attr("class","tip");obj.next().html('数值过大不合理，请重新输入！');return false; }		

		var obj = $('#room_price');
		var room_price = obj.val();
		if(IsEmpty(room_price,obj,'涂料单价不能为空！')) return false;
		if(CheckNum(room_price,'涂料单价只能输入数字格式!',obj)) return false;
		if(room_price>10000) { obj.next().attr("class","tip");obj.next().html('数值过大不合理，请重新输入！');return false; }		

		var room_num = 0;
		var room_total = 0;
		var total_area = 0;
		var door_area = 0;
		var window_area = 0;
		var jgspan_area = 0;
		total_area = wall_long*2*room_long*2*wall_width//总面积
		door_area  = door_height*door_width*door_num//门面积
		window_area = window_height*window_width*window_num//窗面积
		jgspan_area = total_area-door_area-window_area;
		jgspan_area = jgspan_area.toFixed(2);

		 room_num = (parseFloat(room_long)+parseFloat(wall_width))*2*wall_long+parseFloat(room_long*wall_width);
		 room_num = room_num-parseFloat(door_height*door_width*door_num);
		 room_num = room_num-parseFloat(window_height*window_width*window_num);
		 room_num = Math.round(room_num/paint_cover*100)/100;
		 room_total = room_num*parseFloat(room_price);
		 room_total = room_total.toFixed(2);
		 room_total = MilliFormat(room_total);

		$('#room_num').html(room_num);
		$('#room_total').html(room_total);
 
 		$('#jgspan_area').html(jgspan_area);
		$('#tl_area').val(jgspan_area);
		$('#print_area').val(jgspan_area);
		$('#jgspan_price').html(room_price);
		$('#tl_price').val(room_price);
		$('#print_price').val(room_price);
		$('#jgspan_num').html(room_num);
		$('#tl_num').val(room_num);
		$('#print_num').val(room_num);
		$('#jgspan_total').html(room_total);
		$('#tl_total').val(room_total);
		$('#print_total').val(room_total);
	}